package com.smart.campus.school.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.smart.campus.school.mapper.PsychologicalTestItemMapper;
import com.smart.campus.school.domain.PsychologicalTestItem;
import com.smart.campus.school.service.IPsychologicalTestItemService;
import com.smart.campus.common.core.text.Convert;

/**
 * 心理测试题Service业务层处理
 * 
 * @author Zhihe.Li
 * @date 2020-05-27
 */
@Service
public class PsychologicalTestItemServiceImpl implements IPsychologicalTestItemService 
{
    @Autowired
    private PsychologicalTestItemMapper psychologicalTestItemMapper;

    /**
     * 查询心理测试题
     * 
     * @param id 心理测试题ID
     * @return 心理测试题
     */
    @Override
    public PsychologicalTestItem selectPsychologicalTestItemById(Long id)
    {
        return psychologicalTestItemMapper.selectPsychologicalTestItemById(id);
    }

    /**
     * 查询心理测试题列表
     * 
     * @param psychologicalTestItem 心理测试题
     * @return 心理测试题
     */
    @Override
    public List<PsychologicalTestItem> selectPsychologicalTestItemList(PsychologicalTestItem psychologicalTestItem)
    {
        return psychologicalTestItemMapper.selectPsychologicalTestItemList(psychologicalTestItem);
    }

    /**
     * 新增心理测试题
     * 
     * @param psychologicalTestItem 心理测试题
     * @return 结果
     */
    @Override
    public int insertPsychologicalTestItem(PsychologicalTestItem psychologicalTestItem)
    {
        return psychologicalTestItemMapper.insertPsychologicalTestItem(psychologicalTestItem);
    }

    /**
     * 修改心理测试题
     * 
     * @param psychologicalTestItem 心理测试题
     * @return 结果
     */
    @Override
    public int updatePsychologicalTestItem(PsychologicalTestItem psychologicalTestItem)
    {
        return psychologicalTestItemMapper.updatePsychologicalTestItem(psychologicalTestItem);
    }

    /**
     * 删除心理测试题对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deletePsychologicalTestItemByIds(String ids)
    {
        return psychologicalTestItemMapper.deletePsychologicalTestItemByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除心理测试题信息
     * 
     * @param id 心理测试题ID
     * @return 结果
     */
    @Override
    public int deletePsychologicalTestItemById(Long id)
    {
        return psychologicalTestItemMapper.deletePsychologicalTestItemById(id);
    }
}
